package classWork;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Stream02 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        list.add("张三丰");
        list.add("张无忌");
        list.add("张翠山");
        list.add("王二麻子");
        list.add("张良");
        list.add("谢广坤");
        Stream<String> s1 = list.stream().filter(s -> s.startsWith("张"));
        Stream<String> s2 = list.stream().filter(s -> s.length()==3);
        Stream<String> concat = Stream.concat(s1, s2);
        concat.limit(3).forEach(s -> System.out.println(s));
    }
}
